package com.zwb.service.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 头发又黑又长
 * @Date 2022/8/27 18:55
 * @email zwb15083976291@163.com
 */
@EnableSwagger2
@Configuration
public class Swagger2Config {
    @Bean
    public Docket docket() {
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        // API帮助文档的描述信息 infomation
        ApiInfoBuilder apiInfoBuilder = new ApiInfoBuilder();
        // 配置文档主体内容
        apiInfoBuilder.contact(new Contact("云e办 开发文档", // 文档的发布者
                "http://www.tfyhyc.cn", // 当前文档发布者的的网址
                "3092298979@qq.com")); // 文档发布者的电子游戏
        apiInfoBuilder.title("spring-boot-cloud-e-office"); // 设置文档的标题
        apiInfoBuilder.version("1.1.1"); // 设置版本
        docket.apiInfo(apiInfoBuilder.build())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.zwb.service.controller")).build();
        return docket;
    }






}
